<?php
my_component_load('testing' , false);
my_component_load('paging' , false); 
my_component_load('data_setting', false);
my_component_load('spd_biaya_jabatan' );
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;
$modulname = "Admin _BN_ Konfigurasi Data _BN_ Biaya Jabatan (STPD)";

if($_SERVER['REQUEST_METHOD'] == "POST" ):
    
	switch($task){
		case   "edit_biaya_jabatan_page" :
			$validatepost = biaya_jabatan_validate($id);
			if($validatepost){
				$errors = message_multi_error($validatepost);
				$content = $errors;
				$content .= form_biaya_jabatan($id);
				generate_my_web($content,"","plain.php");
				exit; 
			}else{
				biaya_jabatan_submit($id);
				$content =  "Updated";
				generate_my_web($content,"","plain.php");
				exit;
			 }
		break; 
	}

else: 	
	if($task == "edit_biaya_jabatan"){
		$title= ($id > '0' ) ?  "Perubahan Data" : "Tambah Data";
		facebox_page('index.php?com='.$_GET['com'].'&task=edit_biaya_jabatan_page&id='.$id , $title , 250	); 
	}elseif($task == "edit_biaya_jabatan_page"){ 
		$content  = form_biaya_jabatan($id);
		generate_my_web($content,"","plain.php");
		exit; 
	}elseif($task == 'delete_biaya_jabatan'){ // DELETE ITEM	
		biaya_jabatan($id);
		my_direct('index.php?com='.$_GET['com']);
	}else{
		$pagename = "Tarif Biaya Jabatan untuk STPD";
		load_facebox_script();
		$view =  list_biaya_jabatan(); 
		$href = 'index.php?com='.$_GET['com'].'&task=edit_biaya_jabatan&id=0' ;	
		$content = spliter_browser( $view , $pagename ,$href);
		generate_my_web($content, $modulname );		
	}
endif; 

?>